package com.itheima.manager;

import com.itheima.common.R;
import com.itheima.domain.SkuStock;
import com.itheima.service.ISkuStockService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Component;

@Component
public class PmsSkuStockManager {

    @DubboReference
    ISkuStockService skuStockService;

    public R update(Integer pid, SkuStock skuStockList) {
        skuStockService.update(pid,skuStockList);
        return R.success(null);
    }

    public R getByIdAndSku(Integer pid, String keyword) {

        SkuStock byIdAndSku = skuStockService.getByIdAndSku(pid, keyword);
        return R.success(byIdAndSku);

    }
}
